import java.nio.channels.SocketChannel;
import edu.cmu.ece.ds.droidchat.message.DroidChatMessage;

/**
 * This class represents the object that the worker thread processes
 * 
 */
public class WorkerData {
	private NioServer server; // a reference to the NioServer object so that the
							  //  worker thread can call sendToClient() or
							  //  multicastToServers() or
							  //  sendToServer()
	
	private SocketChannel socket;
	private Object message; // could be a DroidChatMessage or ServerMessage
	
	private String serverName; // if this message is ServerMessage, which server was it from
	
	public WorkerData(NioServer server, SocketChannel socket, Object data) {
		this.server = server;
		this.socket = socket;
		this.message = data;
	}
	
	public NioServer getServer() 		{	return server;	}
	public SocketChannel getSocket() 	{	return socket;	}
	public Object getMessage(){	return message;	}
	
	public void setMessageSource(String serverName){
		this.serverName = serverName;
	}
	
	public String getServerName(){
		return serverName;
	}
}
